package project;

import java.awt.*;
import javax.swing.*;

public class PixieFactory {
	public static void addComponents(JComponent container, LayoutManager lm,  JComponent... components) {
		container.setLayout(lm);
		for(JComponent comp : components)
			container.add(comp);
	}
	
	public static void setForegrounds(Color c, JComponent... components) {
		for(JComponent comp : components)
			comp.setForeground(c);		
	}
	
	public static void setBackgrounds(Color c, JComponent... components) {
		for(JComponent comp : components)
			comp.setBackground(c);		
	}
	
	public static void setFonts(Font f, JComponent... components) {
		for(JComponent comp : components)
			comp.setFont(f);
	}

	public static ImageIcon retrieveIcon(String path){
/*	 	java.net.URL imgUrl = project.Pixila.class.getResource(path);
		ImageIcon icon = new ImageIcon(imgUrl);
*/		 	
		ImageIcon icon = new ImageIcon(path);
		return icon;
	}
	
	public static JPanel separator(int height) {
		JPanel jp = new JPanel(new GridBagLayout());
		JSeparator sep = new JSeparator(JSeparator.VERTICAL);
		sep.setPreferredSize(new Dimension(2, height));
		jp.add(sep);

		return jp;
	}

}
